package com.heartline.init;

import com.blade.Environment;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

/**
 * 自定义的一些数据
 * Created by zhy on 2018/6/8.
 */
@Slf4j
public final class Env {
    //    private static BiMap<String, Integer> meizu = HashBiMap.create(); //双向hash表
    private static Map<String, Integer> meizu = new HashMap<>();
    private static Environment environment;

    public static void setEnvironment(Environment environment) {
        Env.environment = environment;
    }

    public static void putMeizuCity(String key, Integer value) {
        meizu.put(key, value);
    }

    public static Integer getCityCode(String name) {
        return meizu.get(name);
    }

    public static String get(String key, String defaultValue) {
        return environment.get(key, defaultValue);
    }
}
